/* 用户注册前的初始钩子，通过钩子干涉内置逻辑的功能
 详见：https://doc.dcloud.net.cn/uniCloud/uni-id/summary.html#before-register ，钩子beforeRegister
 */
// import {
//   store
// } from "@/uni_modules/uni-id-pages/common/store.js"

function beforeRegister({
  userRecord,
  clientInfo
} = {}) {
  //注册时记录初次签到时间，添加积分
  userRecord.signInTime = new Date().getTime()
  userRecord.integral = 1
  userRecord.viewCount = 0
  return userRecord // 务必返回处理后的userRecord,用户的初始数据
}

module.exports = {
  beforeRegister
}